#!/usr/bin/env bash

# Test given path

if [[ ! -d $1 ]]
then
    echo 'Usage: svn_missing_file_ids path'
    exit 1
else
    echo
    echo 'Working, please wait.'
    echo
fi

# Config

path=$1
mask='.php,.xml,.ini,.text'

# Split mask

mask="(`echo $mask | awk 'gsub(/,/, "|", $0) {print $0}'`)$"

# Get directories

dirs=`find $path -type f | awk -v mask=$mask '$0 ~ mask {print $0}'`

# Get files with missing svn:keyword 'Id'

missing=''

for file in $dirs
do
    echo $file
    #svn proplist --verbose $dir
done

echo 
echo 'Done.'
exit 0
